package com.cskaoyan.controller;

import com.cskaoyan.bean.baseresultVO.BaseRespVo;

import com.cskaoyan.bean.dashboardmodel.DashBoardVo;
import com.cskaoyan.service.DashBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lirui
 * @Date 2021/11/29 22:13
 * @describe:
 */

@RestController
@RequestMapping("admin")
public class DashboardController {

    @Autowired
    DashBoardService dashBoardService;

    @RequestMapping("dashboard")
    public BaseRespVo dashboard(DashBoardVo dashBoardVo){

        dashBoardVo.setGoodsTotal(dashBoardService.querygoodsnum());
        dashBoardVo.setUserTotal(dashBoardService.queryusernum());
        dashBoardVo.setProductTotal(dashBoardService.queryproductnum());
        dashBoardVo.setOrderTotal(dashBoardService.queryordertotal());

        return BaseRespVo.ok(dashBoardVo);

    }
    


}
